/*
 * Copyright (c) Huawei Device Co., Ltd. 2023. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include <gtest/gtest.h>
#include <memory>

#include "access_rule_cache.h"
#include "mock_arf_manager.h"
#include "ref_ar_do_mock.h"
#include "response_all_ref_ar_do_mock.h"

namespace OHOS {
namespace SE {
namespace TEST {
using namespace testing::ext;
using namespace OHOS::SE;

class AccessRuleCacheTest : public testing::Test {
public:
    static void SetUpTestCase() {};
    static void TearDownTestCase() {};
    void SetUp();
    void TearDown();
};

void AccessRuleCacheTest::SetUp()
{
}

void AccessRuleCacheTest::TearDown()
{
}

/**
 * @tc.name: Initialize_Test004
 * @tc.desc: Test Initialize.
 * @tc.type: FUNC
 */
HWTEST_F(AccessRuleCacheTest, Initialize_Test004, TestSize.Level1)
{
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("eSE");
    agent->Initialize();
    agent->OnStateChange(true);
    std::shared_ptr<AccessRuleCache> accessRuleCache= std::make_shared<AccessRuleCache>(false, true, agent);
    accessRuleCache->Initialize();
    accessRuleCache->Initialize();
    EXPECT_TRUE(accessRuleCache != nullptr);
}
} // TEST
} // SE
} // OHOS